import { Component, createApp } from 'vue'
// import '@hive-plus/theme-chalk/src/dark/css-vars.scss'
// import '@hive-plus/theme-chalk/src/notification.scss'
// import '@hive-plus/theme-chalk/src/message-box.scss'
// import '@hive-plus/theme-chalk/src/message.scss'
import HivePlus from 'hive-plus'
import '@hive-plus/theme-chalk/src/index.scss'

  ; (async () => {
    const apps = import.meta.glob<
      true,
      string,
      () => Promise<{ default: Component }>
    >('./src/*.vue')
    const name = location.pathname.replace(/^\//, '') || 'App'
    const file = apps[`./src/${name}.vue`]
    if (!file) {
      location.pathname = 'App'
      return
    }
    const App = (await file()).default
    const app = createApp(App)

    app.use(HivePlus)

    app.mount('#play')
  })()
